cmake_minimum_required(VERSION 3.10)  # 更新到更高版本
project(mymuduo)

# 设置输出库路径
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

# 设置全局编译选项
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")

# 获取当前目录下的源文件列表
aux_source_directory(. SRC_LIST)

# 添加共享库
add_library(mymuduo SHARED ${SRC_LIST})

# 设置输出路径
set_target_properties(mymuduo PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH})